@extends("admin.frame_layout")
<?php $top_selected = "会员管理";
if ($flag == 0) {
    $page_menu = "申请中的处理";
} elseif ($flag == 1) {
    $page_menu = "通过申请的报单中心";
} elseif ($flag == 2) {
    $page_menu = "已拒绝的申请记录";
}
?>
@section('content')
    <div class="rightinfo">
        <div class="tools">
            <form method="get" id="sform" action="">
                <ul class="toolbar">
                    <li>
                        <input type="text" name="start" placeholder="开始时间"
                               onClick="laydate({istime: true,format: 'YYYY-MM-DD hh:mm:ss'})">
                    </li>
                    <li>
                        <input type="text" name="end" placeholder="结束时间"
                               onClick="laydate({istime: true,format: 'YYYY-MM-DD hh:mm:ss'})">
                    </li>
                    <li>
                        <select name="search_type">
                            <option value="2">报单中心申请编号</option>
                            <option value="1">用户帐号</option>
                            <option value="3">用户ID</option>
                        </select>
                    </li>
                    <li>
                        <input id="search_str" name="search_str" type="text" placeholder="搜索条件">
                    </li>
                    <li>
                        <a href="javascript:void(0)" onclick="$('#sform').submit()">
                            <span><img src="{{asset('admin/imgs/ico06.png')}}" width="20px"
                                       height="20px"/></span>搜索
                        </a>
                    </li>
                </ul>
            </form>
        </div>

        <table class="tablelist">
            <thead>
            <tr>
                <th width="70px">操作</th>
                <th width="80px">ID<i class="sort"><img src="{{asset('admin/imgs/px.gif')}}"/></i></th>
                {{--<th width="100px">用户ID<i class="sort"><img src="{{asset('admin/imgs/px.gif')}}"/></i></th>--}}
                <th>编号</th>
                <th>用户名</th>
                <th>申请方式</th>
                <th>总金额</th>
                <th>奖金币</th>
                <th>报单币</th>
                <th>状态</th>
                <th style="text-align: left;">后台处理意见</th>
                <th width="150px">申请时间</th>
            </tr>
            </thead>
            <tbody>
            @foreach($userlogs as $userlog)
                <tr>
                    <td class="act" bind="#{{$userlog->id}}">
                        <img src="{{asset('admin/imgs/t05.png')}}"/>菜单
                        @if($flag == 0)
                            <ul id="{{$userlog->id}}">
                                <li onclick="openAllowDlg({{$userlog->id}})">
                                    <img src="{{asset('admin/imgs/d02.png')}}"/>通过审核
                                </li>
                                <li onclick="openDenyDlg({{$userlog->id}})">
                                    <img src="{{asset('admin/imgs/d02.png')}}"/>拒绝申请
                                </li>
                            </ul>
                        @endif
                    </td>
                    <td>{{$userlog->id}}</td>
                    {{--<td>{{$userlog->uid}}</td>--}}
                    <td>{{$userlog->no}}</td>
                    <td>{{$userlog->username}}</td>
                    <td>
                        @if($userlog->method == 1)
                            100% 奖金币报单
                        @elseif($userlog->method ==2)
                            {{cv("bonus.bd_jjb")}}% 奖金币 + {{cv("bonus.bd_bdb")}}% 报单币
                        @endif
                    </td>
                    <td class="red">{{$userlog->z_money}}</td>
                    <td class="red">{{$userlog->jjb}}</td>
                    <td class="red">{{$userlog->bdb}}</td>
                    <td>
                        @if($userlog->status == \App\Models\MBdzxLog::bdzx_sh_apply)
                            <span class="red">待审核</span>
                        @elseif($userlog->status == \App\Models\MBdzxLog::bdzx_sh_no)
                            <span class="red">已拒绝</span>
                        @elseif($userlog->status == \App\Models\MBdzxLog::bdzx_sh_yes)
                            <span class="green">已通过</span>
                        @endif
                    </td>
                    <td class="text-left">{{$userlog->result or "无"}}</td>
                    <td>{{date("Y-m-d H:i:s",$userlog->time)}}</td>
                </tr>
            @endforeach
            </tbody>
        </table>
        @include('admin.coms.fenye')
    </div>
    @include('admin.coms.allow-bdzx')
    @include('admin.coms.deny-bdzx')
@endsection
@section('footer')
    <script src="{{asset('admin/js/laydate/laydate.js')}}"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            laydate.skin("dahong"); //大红色日期选择皮肤
            //初始化表格操作菜单
            $('.tablelist tbody tr:odd').addClass('odd');
            $(".tablelist .act").hover(function () {
                $($(this).attr("bind")).show();
            }, function () {
                $($(this).attr("bind")).hide();
            });
        });
    </script>
@endsection

